/*
cAndy Apple Core: An Apple //e emulator engine
    - based almost entirely on AppleWin

Copyright (C) 1994-1996, Michael O'Brien
Copyright (C) 1999-2001, Oliver Schmidt
Copyright (C) 2002-2005, Tom Charlesworth
Copyright (C) 2006-2008, Tom Charlesworth, Michael Pohoreski, Nick Westgate
Copyright (C) 2009-2010, Garnet Ulrich

cAndy Apple Core is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

cAndy Apple Core is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with cAndy Apple Core; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// this is all based on linapple
// these functions are to map MS specific functions to more general functions (like VirtualAlloc to malloc)

#include "wwrapper.h"

LPVOID VirtualAlloc(LPVOID lpAddress, size_t dwSize, DWORD flAllocationType, DWORD flProtect) {
	void* mymemory;
	mymemory = malloc(dwSize);
	if(flAllocationType & 0x1000) ZeroMemory(mymemory, dwSize);
	return mymemory;
}

BOOL VirtualFree(LPVOID lpAddress, size_t dwSize,
			DWORD dwFreeType) {
	free(lpAddress);
	return TRUE;
}

// make all chars in buffer lowercase
DWORD CharLowerBuff(LPTSTR lpsz, DWORD cchLength)
{
	if (lpsz)
		for (lpsz; *lpsz; lpsz++)
			*lpsz = tolower(*lpsz);
	return 1;
}
